
var ajaxTime = 0
export default (params) => {
	ajaxTime++;
	//加载中
	uni.showLoading({title:"加载中"})
	
	let url = "http://157.122.54.189:9088" + params.url

	return new Promise((resolve, reject) => {
		wx.request({
			...params,
			url,
			success(res) {
				resolve(res.data.res)
			},
			fail(err) {
				reject(err)
			},
			complete() {
				ajaxTime--;
				if(ajaxTime == 0){uni.hideLoading()}
			}
		})

	})
}
